package com.cn.wanxi.util;

public class Tool {
    public static int stringToInt(String value) {
        try {
            return Integer.parseInt(value);
        } catch (Exception e) {
//            e.printStackTrace();
        }
        return 0;
    }

    public static String nullToString(String value) {
        try {
            return value == null ? "" : value;
        } catch (Exception e) {
//            e.printStackTrace();
        }
        return "";
    }

    public static int enableToInt(String value) {
        try {
            return Integer.parseInt(value);
        } catch (Exception e) {
//            e.printStackTrace();
        }
        return -1;
    }

    public static int pageToInt(String value) {
        try {
            return Integer.parseInt(value);
        } catch (Exception e) {
//            e.printStackTrace();
        }
        return 1;
    }

    public static int limitToInt(String value) {
        try {
            return Integer.parseInt(value);
        } catch (Exception e) {
//            e.printStackTrace();
        }
        return 10;
    }
}
